home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / others / ole_101.zip / SCHMOO.ZIP / SCHMOO.H < prev    next >
C/C++ Source or Header  |  1992-04-13  |  6KB  |  198 lines

  1. /*
  2.  * SCHMOO.H
  3.  *
  4.  * Definitions and function prototypes for the OLE Schmoo Server.
  5.  *
  6.  * Copyright(c) Microsoft Corp. 1992 All Rights Reserved
  7.  */
  8.  
  9. #include ".\polyline.h"
  10.  
  11. //Resource identifiers.
  12. #define IDR_MENU            1
  13. #define IDR_ACCELERATORS    1
  14. #define IDD_ABOUT           1
  15.  
  16. //POLYLINE Window ID
  17. #define ID_POLYLINE         10
  18.  
  19.  
  20. //Menu command identifiers.
  21. #define IDM_FILENEW         100
  22. #define IDM_FILEOPEN        101
  23. #define IDM_FILESAVE        102
  24. #define IDM_FILESAVEAS      103
  25. #define IDM_FILEIMPORT      104
  26. #define IDM_FILEEXIT        110
  27.  
  28. #define IDM_EDITUNDO        200
  29. #define IDM_EDITCUT         201
  30. #define IDM_EDITCOPY        202
  31. #define IDM_EDITPASTE       203
  32.  
  33. #define IDM_HELPABOUT       300
  34.  
  35.  
  36. //File-related string lengths.
  37. #define CCHPATHMAX          256
  38. #define CCHFILENAMEMAX      15
  39.  
  40.  
  41.  
  42. /*
  43.  * CSTRINGS is number of strings to load from the stringtable.
  44.  * CCHSTRINGMAX is the maximum length that any string is allowed.
  45.  *
  46.  * What will happen is that CSTRINGS*CCHSTRINGMAX is allocated to begin
  47.  * with and the stringtable is loaded into that space, Only using what's
  48.  * required for each string.  After that, the space is reallocated to
  49.  * be as small as possible.
  50.  */
  51.  
  52. #define CSTRINGS            30
  53. #define CCHSTRINGMAX        80
  54.  
  55.  
  56.  
  57. //String ID values.  Keep in SEQUENTIAL order and use 0-n
  58. #define IDS_CAPTION         0
  59. #define IDS_CLASSSCHMOO     1
  60. #define IDS_CLASSPOLYLINE   2
  61. #define IDS_FILEDIRTY       3
  62. #define IDS_DEFEXT          4
  63. #define IDS_FILEOPENFILTER  5
  64. #define IDS_FILEOPEN        6
  65. #define IDS_FILESAVEAS      7
  66. #define IDS_FILEIMPORT      8
  67. #define IDS_FULLNAME        9
  68. #define IDS_FIGURE          10
  69. #define IDS_DOTEXT          11
  70. #define IDS_MODULE          12
  71. #define IDS_UNTITLED        13
  72. #define IDS_EMPTY           14
  73.  
  74. #define IDS_VERBEDIT        15
  75. #define IDS_UPDATE          16
  76. #define IDS_SAVE            17
  77. #define IDS_SAVEAS          18
  78. #define IDS_SAVECOPYAS      19
  79. #define IDS_EXIT            20
  80. #define IDS_EXITANDRETURN   21
  81. #define IDS_EMBEDDING       22
  82. #define IDS_NATIVE          23
  83. #define IDS_DATAFORMATS     24
  84. #define IDS_STDFILEEDITING  25
  85. #define IDS_OWNERLINK       26
  86. #define IDS_OBJECTLINK      27
  87.  
  88. #define IDS_CLOSEALERT1     28
  89. #define IDS_CLOSEALERT2     29
  90.  
  91.  
  92.  
  93.  
  94. /*
  95.  * Structure holding the "global" variables.  Creating a structure with
  96.  * has several advantages over separately declaring each field as a
  97.  * global:
  98.  *  1.  Keep source files clean.
  99.  *  2.  Eliminates need for many "extern" declarations.
  100.  *  3.  A single pointer to this structure can be passed throughout
  101.  *      the application, hiding the fact that it's global.
  102.  *  4.  Allows the variables to be allocated dynamically or from
  103.  *      different memory than the application's DS.
  104.  *  5.  Any reference to these variables will have a pointer or
  105.  *      structure dereference, which points to where the variable
  106.  *      actually is defined.  Separate globals are not distinguishable
  107.  *      from locals, making code harder to read.
  108.  *
  109.  * Note that fNoDirty is used from OLEOBJ.C in the ObjShow method
  110.  * to prevent setting fDirty when the window is sized from ObjShow.
  111.  */
  112.  
  113. typedef struct
  114.     {
  115.     HWND        hWnd;               //Top-level application window.
  116.     HWND        hWndPolyline;       //Editor window.
  117.     HANDLE      hInst;              //Application instance handle.
  118.     LPSTR       pszCmdLine;         //Command line passed to WinMain.
  119.     WORD        nCmdShow;           //Initial ShowWindow command.
  120.     HANDLE      hStringMem;         //Stringtable memory.
  121.     WORD        cfSchmoo;           //Private clipboard format.
  122.     BOOL        fDirty;             //Is file dirty?
  123.     BOOL        fNoDirty;           //If TRUE, don't touch dirty flag.
  124.     BOOL        fOpenFile;          //FALSE if File/New used until saved.
  125.     char        szFile[CCHPATHMAX]; //Filename for Save command.
  126.  
  127.     BOOL        fOLE;               //Indicates if we are linked/embedded.
  128.     } GLOBALS;
  129.  
  130. typedef GLOBALS FAR * LPGLOBALS;
  131.  
  132. //External:
  133. extern char NEAR *rgpsz[CSTRINGS];
  134. extern LPGLOBALS pGlob;
  135.  
  136.  
  137. //Versioning.
  138. #define VERSIONMAJOR        1
  139. #define VERSIONMINOR        0
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. /*
  148.  * Function prototypes, organized by source file.  Any small definition
  149.  * required by only one source file is also included here under the
  150.  * same heading.
  151.  */
  152.  
  153. //CLIP.C
  154. BOOL     FAR PASCAL FEditCut(LPGLOBALS);
  155. BOOL     FAR PASCAL FEditCopy(LPGLOBALS, BOOL);
  156. BOOL     FAR PASCAL FEditPaste(LPGLOBALS);
  157. HANDLE   FAR PASCAL HGetPolyline(HWND);
  158. HANDLE   FAR PASCAL HGetMetafilePict(HWND);
  159. HANDLE   FAR PASCAL HGetBitmap(HWND);
  160.  
  161.  
  162. //COMMDLG.C
  163. BOOL     FAR PASCAL FSaveOpenDialog(HWND, HANDLE, LPSTR, LPSTR, LPSTR, LPSTR, BOOL);
  164.  
  165. //EXIT.C
  166. BOOL     FAR PASCAL FApplicationExit(LPGLOBALS);
  167.  
  168. //FILE.C
  169. BOOL     FAR PASCAL FDirtySet(BOOL);
  170. BOOL     FAR PASCAL FCleanVerify(LPGLOBALS);
  171. BOOL     FAR PASCAL FFileNew(LPGLOBALS);
  172. BOOL     FAR PASCAL FFileOpen(LPGLOBALS, BOOL);
  173. BOOL     FAR PASCAL FFileSave(LPGLOBALS);
  174. BOOL     FAR PASCAL FFileSaveAs(LPGLOBALS);
  175. BOOL     FAR PASCAL FFileExit(LPGLOBALS);
  176.  
  177. //FILEIO.C
  178. BOOL     FAR PASCAL FMooFileRead(LPGLOBALS, LPSTR, LPPOLYLINE);
  179. BOOL     FAR PASCAL FMooFileWrite(LPGLOBALS, LPSTR, LPPOLYLINE);
  180.  
  181.  
  182. //INIT.C
  183. BOOL     FAR PASCAL FApplicationInit(LPGLOBALS, HANDLE);
  184. BOOL     FAR PASCAL FClassRegister(LPGLOBALS, HANDLE);
  185. BOOL     FAR PASCAL FFileInit(LPGLOBALS);
  186. HANDLE   FAR PASCAL HLoadAppStrings(LPGLOBALS);
  187. HANDLE   FAR PASCAL HListParse(LPSTR);
  188. LPSTR        PASCAL PszWhiteSpaceScan(LPSTR, BOOL);
  189.  
  190. //MISC.C
  191. void     FAR PASCAL WindowTitleSet(HWND, LPSTR);
  192. void     FAR PASCAL RectConvertToHiMetric(HWND, LPRECT);
  193. void     FAR PASCAL RectConvertToDevice(HWND, LPRECT);
  194.  
  195. //SCHMOO.C
  196. LONG     FAR PASCAL SchmooWndProc(HWND, UINT, UINT, LONG);
  197. BOOL     FAR PASCAL AboutProc(HWND, UINT, UINT, LONG);
  198.